{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "toc_visible": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# Table Question Answering\n",
        "\n",
        "![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)\n",
        "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/nlu/blob/master/examples/colab/component_examples/table_question_answering/table_question_answering_with_tapas.ipynb)\n"
      ],
      "metadata": {
        "id": "OkOiSHgdV1yK"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "## TAPAS\n",
        "\n",
        "TapasForQuestionAnswering can load TAPAS Models with a cell selection head and optional aggregation head on top for question-answering tasks on tables (linear layers on top of the hidden-states output to compute logits and optional logits_aggregation), e.g. for SQA, WTQ or WikiSQL-supervised tasks. TAPAS is a BERT-based model specifically designed (and pre-trained) for answering questions about tabular data.\n",
        "\n",
        "\n",
        "[TAPAS: Weakly Supervised Table Parsing via Pre-training](https://aclanthology.org/2020.acl-main.398.pdf)\n",
        "\n",
        "![TAPAS](https://user-images.githubusercontent.com/5762953/192140733-e08a1e99-0aee-455d-af29-73af497a03ef.png)"
      ],
      "metadata": {
        "id": "jT0H7LOOc0g8"
      }
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "2e80CsPqVk2i"
      },
      "outputs": [],
      "source": [
        "%%capture\n",
        "! pip install nlu\n",
        "! pip install pyspark==3.1.1"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import pandas as pd \n",
        "\n",
        "# First we need a pandas dataframe on for which we want to ask questions. The so called \"context\"\n",
        "context_df = pd.DataFrame({\n",
        "    'name':['Donald Trump','Elon Musk'], \n",
        "    'money': ['$100,000,000','$20,000,000,000,000'], \n",
        "    'married': ['yes','no'], \n",
        "    'age' : ['75','55'] })\n",
        "context_df"
      ],
      "metadata": {
        "id": "RR7xIxxtc1KK",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 112
        },
        "outputId": "6b48e4e9-7a3e-4ca9-e5f3-9a3e70f7e492"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "           name                money married age\n",
              "0  Donald Trump         $100,000,000     yes  75\n",
              "1     Elon Musk  $20,000,000,000,000      no  55"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-f52f6c60-1014-4802-a087-20e664fda461\">\n",
              "    <div class=\"colab-df-container\">\n",
              "      <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>name</th>\n",
              "      <th>money</th>\n",
              "      <th>married</th>\n",
              "      <th>age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Donald Trump</td>\n",
              "      <td>$100,000,000</td>\n",
              "      <td>yes</td>\n",
              "      <td>75</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>$20,000,000,000,000</td>\n",
              "      <td>no</td>\n",
              "      <td>55</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f52f6c60-1014-4802-a087-20e664fda461')\"\n",
              "              title=\"Convert this dataframe to an interactive table.\"\n",
              "              style=\"display:none;\">\n",
              "        \n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
              "    <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
              "  </svg>\n",
              "      </button>\n",
              "      \n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      flex-wrap:wrap;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "      <script>\n",
              "        const buttonEl =\n",
              "          document.querySelector('#df-f52f6c60-1014-4802-a087-20e664fda461 button.colab-df-convert');\n",
              "        buttonEl.style.display =\n",
              "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "        async function convertToInteractive(key) {\n",
              "          const element = document.querySelector('#df-f52f6c60-1014-4802-a087-20e664fda461');\n",
              "          const dataTable =\n",
              "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                     [key], {});\n",
              "          if (!dataTable) return;\n",
              "\n",
              "          const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "            '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "            + ' to learn more about interactive tables.';\n",
              "          element.innerHTML = '';\n",
              "          dataTable['output_type'] = 'display_data';\n",
              "          await google.colab.output.renderOutput(dataTable, element);\n",
              "          const docLink = document.createElement('div');\n",
              "          docLink.innerHTML = docLinkHtml;\n",
              "          element.appendChild(docLink);\n",
              "        }\n",
              "      </script>\n",
              "    </div>\n",
              "  </div>\n",
              "  "
            ]
          },
          "metadata": {},
          "execution_count": 15
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# Then we create an array of questions\n",
        "questions = [\n",
        "    \"Who earns less than 200,000,000?\",\n",
        "    \"Who earns more than 200,000,000?\",\n",
        "    \"Who earns 100,000,000?\",\n",
        "    \"How much money has Donald Trump?\",\n",
        "    \"Who is the youngest?\",\n",
        "]\n",
        "questions"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Bcuuip8QnPoY",
        "outputId": "c85cb4e8-eb99-4699-d517-0b0d31323ac9"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "['Who earns less than 200,000,000?',\n",
              " 'Who earns more than 200,000,000?',\n",
              " 'Who earns 100,000,000?',\n",
              " 'How much money has Donald Trump?',\n",
              " 'Who is the youngest?']"
            ]
          },
          "metadata": {},
          "execution_count": 16
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# Now we combine both to a tuple and we are done! We can now pass this to the .predict() method\n",
        "tapas_data = (context_df, questions)\n",
        "tapas_data"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ifO-VCSLni8q",
        "outputId": "3caa8f07-9ddf-48f2-8c12-607e5f323dc5"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(           name                money married age\n",
              " 0  Donald Trump         $100,000,000     yes  75\n",
              " 1     Elon Musk  $20,000,000,000,000      no  55,\n",
              " ['Who earns less than 200,000,000?',\n",
              "  'Who earns more than 200,000,000?',\n",
              "  'Who earns 100,000,000?',\n",
              "  'How much money has Donald Trump?',\n",
              "  'Who is the youngest?'])"
            ]
          },
          "metadata": {},
          "execution_count": 17
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import nlu\n",
        "# Lets load a TAPAS QA model and predict on (context,question) \n",
        "tapas = nlu.load('en.answer_question.tapas.wtq.large_finetuned')\n",
        "\n",
        "# It will give us an aswer for every question in the questions array,\n",
        "# based on the context in context_df\n",
        "answers = tapas.predict(tapas_data)\n",
        "answers"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 362
        },
        "id": "MgY4pFCrnMB9",
        "outputId": "514361f1-0ebc-4269-b0b0-09fe2dcb5697"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Warning::Spark Session already created, some configs may not take.\n",
            "Warning::Spark Session already created, some configs may not take.\n",
            "table_qa_tapas_large_finetuned_wtq download started this may take some time.\n",
            "Approximate size to download 1.2 GB\n",
            "[OK!]\n",
            "sentence_detector_dl download started this may take some time.\n",
            "Approximate size to download 354.6 KB\n",
            "[OK!]\n",
            "Warning::Spark Session already created, some configs may not take.\n"
          ]
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "                           sentence tapas_qa_UNIQUE_aggregation  \\\n",
              "0  Who earns less than 200,000,000?                        NONE   \n",
              "0  Who earns more than 200,000,000?                        NONE   \n",
              "0            Who earns 100,000,000?                        NONE   \n",
              "0  How much money has Donald Trump?                         SUM   \n",
              "0              Who is the youngest?                        NONE   \n",
              "\n",
              "  tapas_qa_UNIQUE_answer tapas_qa_UNIQUE_cell_positions  \\\n",
              "0           Donald Trump                         [0, 0]   \n",
              "0              Elon Musk                         [0, 1]   \n",
              "0           Donald Trump                         [0, 0]   \n",
              "0      SUM($100,000,000)                         [1, 0]   \n",
              "0              Elon Musk                         [0, 1]   \n",
              "\n",
              "  tapas_qa_UNIQUE_cell_scores   tapas_qa_UNIQUE_origin_question  \\\n",
              "0                         1.0  Who earns less than 200,000,000?   \n",
              "0                         1.0  Who earns more than 200,000,000?   \n",
              "0                         1.0            Who earns 100,000,000?   \n",
              "0                         1.0  How much money has Donald Trump?   \n",
              "0                         1.0              Who is the youngest?   \n",
              "\n",
              "                                                text  \n",
              "0  {\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...  \n",
              "0  {\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...  \n",
              "0  {\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...  \n",
              "0  {\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...  \n",
              "0  {\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...  "
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-f522f17e-416b-4296-bd4b-19b640595e44\">\n",
              "    <div class=\"colab-df-container\">\n",
              "      <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>sentence</th>\n",
              "      <th>tapas_qa_UNIQUE_aggregation</th>\n",
              "      <th>tapas_qa_UNIQUE_answer</th>\n",
              "      <th>tapas_qa_UNIQUE_cell_positions</th>\n",
              "      <th>tapas_qa_UNIQUE_cell_scores</th>\n",
              "      <th>tapas_qa_UNIQUE_origin_question</th>\n",
              "      <th>text</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Who earns less than 200,000,000?</td>\n",
              "      <td>NONE</td>\n",
              "      <td>Donald Trump</td>\n",
              "      <td>[0, 0]</td>\n",
              "      <td>1.0</td>\n",
              "      <td>Who earns less than 200,000,000?</td>\n",
              "      <td>{\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Who earns more than 200,000,000?</td>\n",
              "      <td>NONE</td>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>[0, 1]</td>\n",
              "      <td>1.0</td>\n",
              "      <td>Who earns more than 200,000,000?</td>\n",
              "      <td>{\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Who earns 100,000,000?</td>\n",
              "      <td>NONE</td>\n",
              "      <td>Donald Trump</td>\n",
              "      <td>[0, 0]</td>\n",
              "      <td>1.0</td>\n",
              "      <td>Who earns 100,000,000?</td>\n",
              "      <td>{\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>How much money has Donald Trump?</td>\n",
              "      <td>SUM</td>\n",
              "      <td>SUM($100,000,000)</td>\n",
              "      <td>[1, 0]</td>\n",
              "      <td>1.0</td>\n",
              "      <td>How much money has Donald Trump?</td>\n",
              "      <td>{\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Who is the youngest?</td>\n",
              "      <td>NONE</td>\n",
              "      <td>Elon Musk</td>\n",
              "      <td>[0, 1]</td>\n",
              "      <td>1.0</td>\n",
              "      <td>Who is the youngest?</td>\n",
              "      <td>{\"header\":[\"name\",\"money\",\"married\",\"age\"],\"ro...</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "      <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f522f17e-416b-4296-bd4b-19b640595e44')\"\n",
              "              title=\"Convert this dataframe to an interactive table.\"\n",
              "              style=\"display:none;\">\n",
              "        \n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "       width=\"24px\">\n",
              "    <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
              "    <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
              "  </svg>\n",
              "      </button>\n",
              "      \n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      flex-wrap:wrap;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "      <script>\n",
              "        const buttonEl =\n",
              "          document.querySelector('#df-f522f17e-416b-4296-bd4b-19b640595e44 button.colab-df-convert');\n",
              "        buttonEl.style.display =\n",
              "          google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "        async function convertToInteractive(key) {\n",
              "          const element = document.querySelector('#df-f522f17e-416b-4296-bd4b-19b640595e44');\n",
              "          const dataTable =\n",
              "            await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                     [key], {});\n",
              "          if (!dataTable) return;\n",
              "\n",
              "          const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "            '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "            + ' to learn more about interactive tables.';\n",
              "          element.innerHTML = '';\n",
              "          dataTable['output_type'] = 'display_data';\n",
              "          await google.colab.output.renderOutput(dataTable, element);\n",
              "          const docLink = document.createElement('div');\n",
              "          docLink.innerHTML = docLinkHtml;\n",
              "          element.appendChild(docLink);\n",
              "        }\n",
              "      </script>\n",
              "    </div>\n",
              "  </div>\n",
              "  "
            ]
          },
          "metadata": {},
          "execution_count": 18
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Try out other models\n",
        "\n",
        " There are many more TAPAS models for question answering\n",
        "\n",
        " You can try any of them out by simply chaning the parameter of `nlu.load('my_model')` to the one you want to test.\n",
        "\n",
        "\n",
        "Refer to the [modelshub](https://nlp.johnsnowlabs.com/models?task=Table+Question+Answering) for the full list\n",
        "\n",
        "\n",
        "\n",
        "| Language   | NLU Reference                                                                                                                                           | Spark NLP  Reference                                                                                                                                     | Annotator Class           |\n",
        "|:-----------|:--------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------|\n",
        "| en         | [en.answer_question.tapas](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_table_question_answering_tapas_en.html)                                     | [table_qa_table_question_answering_tapas](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_table_question_answering_tapas_en.html)                       | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.by_uploaded by huggingface](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_temporary_repo_en.html)                    | [table_qa_tapas_temporary_repo](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_temporary_repo_en.html)                                           | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.sqa.base_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_base_finetuned_sqa_en.html)                        | [table_qa_tapas_base_finetuned_sqa](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_base_finetuned_sqa_en.html)                                   | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.sqa.large_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_large_finetuned_sqa_en.html)                      | [table_qa_tapas_large_finetuned_sqa](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_large_finetuned_sqa_en.html)                                 | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.sqa.medium_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_medium_finetuned_sqa_en.html)                    | [table_qa_tapas_medium_finetuned_sqa](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_medium_finetuned_sqa_en.html)                               | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.sqa.mini_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_mini_finetuned_sqa_en.html)                        | [table_qa_tapas_mini_finetuned_sqa](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_mini_finetuned_sqa_en.html)                                   | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.sqa.small_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_small_finetuned_sqa_en.html)                      | [table_qa_tapas_small_finetuned_sqa](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_small_finetuned_sqa_en.html)                                 | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.sqa.tiny_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_tiny_finetuned_sqa_en.html)                        | [table_qa_tapas_tiny_finetuned_sqa](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_tiny_finetuned_sqa_en.html)                                   | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wikisql.base_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_base_finetuned_wikisql_supervised_en.html)     | [table_qa_tapas_base_finetuned_wikisql_supervised](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_base_finetuned_wikisql_supervised_en.html)     | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wikisql.large_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_large_finetuned_wikisql_supervised_en.html)   | [table_qa_tapas_large_finetuned_wikisql_supervised](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_large_finetuned_wikisql_supervised_en.html)   | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wikisql.medium_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_medium_finetuned_wikisql_supervised_en.html) | [table_qa_tapas_medium_finetuned_wikisql_supervised](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_medium_finetuned_wikisql_supervised_en.html) | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wikisql.small_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_small_finetuned_wikisql_supervised_en.html)   | [table_qa_tapas_small_finetuned_wikisql_supervised](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_small_finetuned_wikisql_supervised_en.html)   | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wtq.large_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_large_finetuned_wtq_en.html)                      | [table_qa_tapas_large_finetuned_wtq](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_large_finetuned_wtq_en.html)                                 | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wtq.medium_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_medium_finetuned_wtq_en.html)                    | [table_qa_tapas_medium_finetuned_wtq](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_medium_finetuned_wtq_en.html)                               | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wtq.mini_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_mini_finetuned_wtq_en.html)                        | [table_qa_tapas_mini_finetuned_wtq](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_mini_finetuned_wtq_en.html)                                   | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wtq.small_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_small_finetuned_wtq_en.html)                      | [table_qa_tapas_small_finetuned_wtq](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_small_finetuned_wtq_en.html)                                 | TapasForQuestionAnswering |\n",
        "| en         | [en.answer_question.tapas.wtq.tiny_finetuned](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_tiny_finetuned_wtq_en.html)                        | [table_qa_tapas_tiny_finetuned_wtq](https://nlp.johnsnowlabs.com/2022/09/30/table_qa_tapas_tiny_finetuned_wtq_en.html)                                   | TapasForQuestionAnswering |\n"
      ],
      "metadata": {
        "id": "78gndWLz8OLG"
      }
    }
  ]
}